<?php
/* @var $this ProductController */
/* @var $model Product */

$this->breadcrumbs = array(
    'Products' => TreTodayUrl::backendProductUrl(true)
);

?>
<a href="<?php echo TreTodayUrl::backendProductCreateUrl() ?>" class="btn btn-default">Create</a>
<div id="" class="admin-main-wrapper form-inline">
    <div class="dataTables_wrapper">

        <?php $this->widget('zii.widgets.grid.CGridView', array(
            'id' => 'product-grid',
            'dataProvider' => $model,
            'columns' => array(
                'product_id',
                'product_name',
                'user_name',
                array('name' => 'published', 'value' => '$data->published == 1 ? "Có" : "Không"'),
                array(
                    'class' => 'CButtonColumn',
                    'template' => '{view}{update}{delete}',
                    'buttons' => array(
                        'view' => array
                        (
                            'label' => 'View',
                            'url' => 'TreTodayUrl::getProductUrl($data->product_id, $data->product_name)',
                            'options' => array("target" => "_blank"),
                        ),

                    )
                ),
            ),
        )); ?>
        <!--        --><?php //$this->widget('zii.widgets.grid.CGridView', array(
        //            'id' => 'product-grid',
        //            'dataProvider'=>$model->search(),
        //            'filter'=>$model,
        //            'columns' => array(
        //                'product_id',
        //                'product_name',
        //                'user_name',
        //                array('name' => 'published', 'value' => '$data->published == 1 ? "Có" : "Không"'),
        //                array(
        //                    'class' => 'CButtonColumn',
        //
        //                ),
        //            ),
        //        ));
        ?>
    </div>
</div>